package net.lqy.aipan.enums;

import lombok.Getter;

public enum BizCodeEnum {
    /**
     * 账号相关错误码
     */
    ACCOUNT_REPEAT(250001, "账号已经存在"),
    ACCOUNT_UNREGISTER(250002, "账号不存在"),
    ACCOUNT_PWD_ERROR(250003, "账号或者密码错误"),
    ACCOUNT_UNLOGIN(250004, "账号未登录"),

    /**
     * BUKET 相关错误码
     */
    BUCKET_NOT_EXISTS(240404, "Bucket不存在"),

    /**
     * Storage存储相关错误码
     */
    STORAGE_NOT_ENOUGH(230401, "存储空间不足"),

    /**
     * 文件操作相关错误码
     */
    FILE_NOT_EXISTS(220404, "文件不存在"),
    FILE_AUTH_FAIL(220464, "文件权限校验失败"),
    FILE_NAME_REPEAT(220465, "文件名重复"),
    FILE_NAME_TOO_MANY_DUPLICATES(220466, "文件名重复过多"),
    FILE_DEL_BATCH_ILLEGAL(220406, "文件删除参数错误"),
    FILE_TYPE_ERROR(220407, "文件类型错误"),
    FILE_CHUNK_TASK_NOT_EXISTS(230408, "分片任务不存在"),
    FILE_CHUNK_NOT_ENOUGH(230409, "分片数量不匹配，合并不够"),
    FILE_STORAGE_NOT_ENOUGH(240403, "存储空间不足"),
    FILE_TARGET_PARENT_ILLEGAL(250403, "目标父级目录不合法"),
    FILE_TARGET_PARENT_NO_EXIST(250404, "目标父级目录不存在"),
    SHARE_CANCEL_ILLEGAL(260403, "取消分享失败,参数不合法"),
    SHARE_CODE_ILLEGAL(260404, "分享码不合法"),
    SHARE_NOT_EXIST(260405, "分享不存在"),
    SHARE_CANCEL(260406, "分享已取消"),
    SHARE_EXPIRED(260407, "分享已过期"),
    SHARE_FILE_ILLEGAL(260408, "分享的文件不合规"),
    FILE_DOWNLOAD_FAILED(260409, "文件下载失败"),
    DOWNLOAD_URL_GENERATE_FAILED(260410, "下载链接生成失败"),
    FILE_MOVE_BATCH_FAIL(270101, "文件批量移动失败");


    @Getter
    private final String message;

    @Getter
    private final int code;

    BizCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
